package cn.source.system.service.impl;

import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.source.system.mapper.AaUserIntegralRecordMapper;
import cn.source.system.domain.AaUserIntegralRecord;
import cn.source.system.service.IAaUserIntegralRecordService;

/**
 * 用户积分Service业务层处理
 * 
 * @author sourcebyte.vip
 * @date 2023-08-04
 */
@Service
public class AaUserIntegralRecordServiceImpl implements IAaUserIntegralRecordService 
{
    @Autowired
    private AaUserIntegralRecordMapper aaUserIntegralRecordMapper;

    /**
     * 查询用户积分
     * 
     * @param id 用户积分主键
     * @return 用户积分
     */
    @Override
    public AaUserIntegralRecord selectAaUserIntegralRecordById(Long id)
    {
        return aaUserIntegralRecordMapper.selectAaUserIntegralRecordById(id);
    }

    /**
     * 查询用户积分列表
     * 
     * @param aaUserIntegralRecord 用户积分
     * @return 用户积分
     */
    @Override
    public List<AaUserIntegralRecord> selectAaUserIntegralRecordList(AaUserIntegralRecord aaUserIntegralRecord)
    {
        return aaUserIntegralRecordMapper.selectAaUserIntegralRecordList(aaUserIntegralRecord);
    }

    /**
     * 新增用户积分
     * 
     * @param aaUserIntegralRecord 用户积分
     * @return 结果
     */
    @Override
    public int insertAaUserIntegralRecord(AaUserIntegralRecord aaUserIntegralRecord)
    {
        aaUserIntegralRecord.setCreateDate(new Date());
        return aaUserIntegralRecordMapper.insertAaUserIntegralRecord(aaUserIntegralRecord);
    }

    /**
     * 修改用户积分
     * 
     * @param aaUserIntegralRecord 用户积分
     * @return 结果
     */
    @Override
    public int updateAaUserIntegralRecord(AaUserIntegralRecord aaUserIntegralRecord)
    {
        return aaUserIntegralRecordMapper.updateAaUserIntegralRecord(aaUserIntegralRecord);
    }

    /**
     * 批量删除用户积分
     * 
     * @param ids 需要删除的用户积分主键
     * @return 结果
     */
    @Override
    public int deleteAaUserIntegralRecordByIds(Long[] ids)
    {
        return aaUserIntegralRecordMapper.deleteAaUserIntegralRecordByIds(ids);
    }

    /**
     * 删除用户积分信息
     * 
     * @param id 用户积分主键
     * @return 结果
     */
    @Override
    public int deleteAaUserIntegralRecordById(Long id)
    {
        return aaUserIntegralRecordMapper.deleteAaUserIntegralRecordById(id);
    }
}
